package com.hq.ims.data.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hq.ims.data.entityenum.EnumAuditStatus;
import com.hq.ims.data.vo.BusiChangeTimeRecordMapstruct;
import com.hq.mybatis.base.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
* @author 蒋柏平
* @since 20241025
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Alias("BusiChangeTimeRecord")
@TableName(value = "busi_change_time_record")
@ApiModel(value = "经营信息变更历史记录", description = "经营信息变更历史记录")
public class BusiChangeTimeRecord extends BaseModel<BusiChangeTimeRecord> implements Serializable {

    @ApiModelProperty(value = "变更历史记录ID")
    @TableId(value = "busi_change_time_record_id",type = IdType.ASSIGN_UUID)
    private String busiChangeTimeRecordId;

    @ApiModelProperty(value = "经营信息管理ID")
    @TableField(value = "busi_info_id")
    private String busiInfoId;

    @ApiModelProperty(value = "变更时间")
    @TableField(value = "change_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime changeTime;

    @ApiModelProperty(value = "变更前ID")
    @TableField(value = "change_before_id")
    private String changeBeforeId;

    @ApiModelProperty(value = "变更后ID")
    @TableField(value = "change_after_id")
    private String changeAfterId;

    @ApiModelProperty(value = "审核状态")
    @TableField(value = "audit_status")
    private EnumAuditStatus auditStatus;

    public BusiChangeTimeRecordMapstruct.BusiChangeTimeRecordRowAuthVo auth(){
        BusiChangeTimeRecordMapstruct.BusiChangeTimeRecordRowAuthVo auth = new BusiChangeTimeRecordMapstruct.BusiChangeTimeRecordRowAuthVo(this);
        return auth;
    }

}
